// -----------------------------
// Author: 		Dhaenens Gert 
// Creation: 	8/2/2013 7:08:34 PM				
// -----------------------------

#ifndef _Lua_h
#define _Lua_h

#include "ObjectLuaCommon.h"

// Lua State Forward Declare
struct lua_State;

namespace ObjectLua
{

	class LuaScript;
	class LuaTable;
	class LuaStack;

	/*
	//	Lua Object
	//	
	//	Used to Interact with the Lua Environment
	//	and provide binding between C++ and Lua
	*/
	class OBJECTLUA Lua
	{
	public:
		Lua();
		~Lua();

		/*
		//	Push an Error onto the stack
		*/
		void			pushError(const char* lpMsg);

		/*
		//	Loads the File into memory
		//	and runs it.
		//	Used to quikcly run a file
		//	without any setup
		//	@ lpFile : path to file
		*/
		void			runFile(const char* lpFile);

		/* 
		//	Add a Path to the 
		//	Lua Path Variable
		//	@ lpPath : path to add
		*/
		void			addPath(const char* lpPath);

		/*
		//	Get the Global Table
		*/
		LuaTable*		getGlobals();
		/*
		//	Get the Stack
		*/
		LuaStack*		getStack();

		/*
		//	Get the lua_State
		*/
		lua_State*		getState() const;
	
	private:

		lua_State*		m_lpState;
		LuaTable*		m_lpGlobalTable;
		LuaStack*		m_lpStack;
	
		Lua(const Lua& refLua);
		Lua& operator=(const Lua& refLua);
	};

}

#endif